<@app.html>
    <@app.head>
    <script>
        $(function () {
            $('#page_table').datagrid({
                fit: true,
                width: '100%',
                height: '100%',
                striped: true,
                pagination: true,
                url: "${contextPath}/security/hdw/withdraw_cash/page.htm",
                fitColumns: true,
                pageSize: 10,
                pageList: [10, 50, 100],
                idField: 'id',
                singleSelect: true,
                selectOnCheck: false,
                checkOnSelect: false,
                autoRowHeight: false,
                rowStyler: gridRowStyler,
                columns: [
                    [
                        {title: '机构类型', align: 'center', field: 'orgTypeName', width: 150},
                        {title: '机构名称', align: 'center', field: 'orgIdName', width: 150},
                        {
                            title: '金额', align: 'center', field: 'money', width: 150,
                            formatter: function (val, row) {
                                return new Number(val / 100).toFixed(2);
                            }
                        },
                        {title: '创建时间', align: 'center', field: 'createTime', width: 150},
                        {
                            title: '操作',
                            align: 'center',
                            field: 'action',
                            width: 250,
                            formatter: function (val, row) {
                                var html = '<a href="javascript:view(ID)">查看</a>';
//                                html += ' <a href="javascript:edit(ID)">修改</a>';
                                html += ' <a href="javascript:remove(ID)">删除</a>';
                                return html.replace(/ID/g, row.id);
                            }
                        }
                    ]
                ],
                onLoadSuccess: function () {
                    $('#page_table').datagrid('clearChecked');
                    $('#page_table').datagrid('clearSelections');
                }
            });
        });


        function reload() {
            var datagrid = $('#page_table');
            datagrid.datagrid('reload');
        }

        function add() {
            App.dialog.show({
                css: 'width:314px;height:300px;overflow:visible;',
                title: '新建',
                href: "${contextPath}/security/hdw/withdraw_cash/add.htm",
                event: {
                    onClose: function () {
                        reload();
                    }
                }
            });
        }
        function edit(id) {
            App.dialog.show({
                css: 'width:314px;height:300px;overflow:visible;',
                title: '修改',
                href: "${contextPath}/security/hdw/withdraw_cash/edit.htm?id=" + id,
                event: {
                    onClose: function () {
                        reload();
                    },
                    onLoad: function () {
                    }
                }
            });
        }
        function view(id) {
            App.dialog.show({
                css: 'width:314px;height:300px;overflow:visible;',
                title: '查看',
                href: "${contextPath}/security/hdw/withdraw_cash/view.htm?id=" + id
            });
        }
        function query() {
            var datagrid = $('#page_table');
            var orgType = $("input[name='orgType']").val();
            datagrid.datagrid('options').queryParams = {
                orgType: orgType
            };
            datagrid.datagrid('load');
        }
        function remove(id) {
            $.messager.confirm('提示信息', '确认删除?', function (ok) {
                if (ok) {
                    $.post('${contextPath}/security/hdw/withdraw_cash/delete.htm', {
                        id: id
                    }, function (json) {
                        if (json.success) {
                            $.messager.alert('提示消息', '操作成功', 'info');
                            reload();
                        } else {
                            $.messager.alert('提示消息', json.message, 'info');
                        }
                    }, 'json');
                }
            });
        }

    </script>
    </@app.head>
    <@app.body>
        <@app.container>
            <@app.banner/>

        <div class="main">
            <@app.menu/>

            <div class="content">
                <div class="panel search">
                    <div class="float_right">
                        <button class="btn btn_yellow" onclick="query()">搜索</button>
                    </div>
                    <table cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td width="80" align="right">机构类型：</td>
                            <td>
                                <select name="orgType" class="easyui-combobox" style="width: 182px; height: 30px;"
                                        editable="false">
                                    <option value="">请选择</option>
                                    <#list orgTypeList as orgType>
                                        <option value="${orgType.getValue()}">${orgType.getName()}</option>
                                    </#list>
                                </select>
                            </td>
                            <#--<td width="80" align="right">机构名称：</td>-->
                            <#--<td><input type="text" class="text" id="orgId"/></td>-->
                        </tr>
                    </table>
                </div>
                <div class="panel grid_wrap">
                    <div class="toolbar clearfix">
                        <div class="float_right">
                            <button class="btn btn_green" onclick="add()">新建</button>
                        </div>
                        <h3>提现</h3>
                    </div>
                    <div class="grid">
                        <table id="page_table"></table>
                    </div>
                </div>
            </div>
        </div>
        </@app.container>
    </@app.body>
</@app.html>


